package com.gdcn.zb.sys.service.impl;

import java.util.List;

import com.gdcn.zb.base.BaseService;
import com.gdcn.zb.base.exception.DaoException;
import com.gdcn.zb.base.exception.ServiceException;
import com.gdcn.zb.sys.dao.ITypeFunctionDao;
import com.gdcn.zb.sys.service.ITypeFunctionService;
import com.gdcn.zb.sys.valueobject.TypeFunction;

public class TypeFunctionServiceImpl  extends BaseService implements ITypeFunctionService {
	private ITypeFunctionDao typeFunctionDao;
	public void setTypeFunctionDao(ITypeFunctionDao typeFunctionDao) {
		this.typeFunctionDao = typeFunctionDao;
	}

	public TypeFunction findTypeFunctionById(int id) throws ServiceException {
		TypeFunction typeFunction = null;
		try{
			typeFunction = typeFunctionDao.findTypeFunctionById(id);
		}catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
		return typeFunction;
	}

	public List listTypeFunctionOfAll() throws ServiceException {
		List list = null;
		try{
			list = typeFunctionDao.listTypeFunctionOfAll();
		}catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
		return list;
	}

	public List listTypes(String parentcode) throws ServiceException {
		List list = null;
		try{
			list = typeFunctionDao.listTypes(parentcode);
		}catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
		return list;
	}



}
